fix(examples): export CliCommandDefinition so declaration emit can name it - #174
Conversation
…me it The audiobook-curator package build's d.ts generation (rslib environment agent-bundle-index) failed with TS4023 on every exported operations factory: their inferred return types reference CliCommandDefinition, which #150 introduced unexported. Declaration emit must import the type from src/cli-command, so `agent-bundle build` failed with AB5000 ("Error occurred in agent-bundle-index declaration files generation.") while `tsc --noEmit` passed. Reported during examples:check in #166's report.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
Summary
pnpm examples:checkfails reproducibly on main: the audiobook-curatoragent-bundle builddies with(observed in #166's report). The underlying TypeScript diagnostics, recovered by replaying the synthesized DTS program (
node_modules/.agent-bundle-dts-*tsconfig) withtsc --declaration --emitDeclarationOnly, are five TS4023s:#150 introduced
src/cli-command.tswithCliCommandDefinitionunexported while the exported operations factories (audibleOperations,discoveryOperations,evidenceOperations,mediaMutationOperations,outputOperations) return objects ofdefineCliCommand(...)results, so their inferred declaration types must name it from other modules. This is emit-only:tsc --noEmit(the example'stypecheck) passes, which is why only the declaration build failed. Fix: export the interface.Not the dev lock: AB5000 is the CLI's catch-all diagnostic code, and the initial report attributed it to dev-lock contention ("another development process owns this project"). The check pipeline (
validate/build/typecheck/test/test:routes) never acquires the dev lock — its only production acquirer is the DevCoordinator behindagent-bundle dev— and dead-pid reclaim is already covered bytests/dev-lock.test.ts("recovers a dead lock only after probing its recorded pid", the eight-contender recovery-gate test). A leakeddev.lockwith a dead owner pid (998818, from this morning's OOM-killed dev session) existed in the primary checkout's example tree and was deleted surgically, but it could not have caused this failure and reproduction succeeds in a pristine worktree.Regression gate
An emit-only TS4023 is invisible to
--noEmittypecheck and to runtime tests by construction; the executable gate is declaration emit itself, whichpnpm --filter ./examples/audiobook-curator check(and the examples-check CI job) runs viaagent-bundle build. That exact reproduction now passes — package build emits all 39 files including the.d.tsgraph.Test plan
tsc --declaration --emitDeclarationOnly, exit 0)pnpm --filter ./examples/audiobook-curator checkgreen (validate, build, typecheck, 35+2 tests)pnpm examples:checkgreenpnpm typecheckand scopedrslintclean